<?
/* ÖzgürSözlük Projesi
  baslik gösterme modülü...
  coded by rohanrhu...
*/

function baslikYok() {}

// ----- Sayfalama Olayı ------
$s = (int)$_GET["s"];
if ($s == "") {$s = 1;}

$s1 = $s * 10;
$s0 = $s1 - 10;
// ------ Sayfalama sonu -------

$baslik = baslikIsle($_GET["baslik"]);
$baslikid = mysql_query("SELECT * FROM baslik WHERE baslik='$baslik';");
$baslikid = @mysql_result($baslikid, 0, "id") or baslikYok();
echo "<a href=\"index.php?baslik=".str_replace(" ", "+", $baslik)."\"><b>$baslik</b></a><br />";

if ($baslikid == "") {echo "Böyle birşey yok be...";}
$entryler = mysql_query("SELECT * FROM entry WHERE baslikid='$baslikid' ORDER by id LIMIT $s0, $s1;");
$entrySayisi = mysql_num_rows($entryler);
$toplamEntrySayisi = mysql_num_rows(mysql_query("SELECT * FROM entry WHERE baslikid='$baslikid';"));

for ($i=0; $i < $entrySayisi; $i++) {
    $entry = mysql_fetch_row($entryler);
    $entryIcerigi = entryIsle($entry[3]);

    echo "<div id=\"entry\" onMouseOver=\"this.style.backgroundColor='#333333';\" onMouseOut=\"this.style.backgroundColor='';\">\n";
    echo "\t<table>\n";
    echo "\t\t<tr><td>".str_replace("\n", "<br />", $entryIcerigi)."</td></tr>\n";
	echo "</table>\n<table>\n";
    echo "\t\t<tr><td><a href=index.php?yazar=$entry[2]><img src=\"templates/default/images/icon_user.gif\" /></a> <a href=\"index.php?baslik=".$entry[2]."\">".$entry[2]."</a></td>";
    echo "<td><a href=\"index.php?entry=$entry[0]\"> #$entry[0]</a></td>";
    echo "<td>".entryDuzenle($girisMi, $entry[2], $entry[0])."</td>";
    echo "<td>".$entry[5]." ~ $entry[9]</td></tr>\n\t</table>\n";
    echo "</div><br />";
}

$sayfaSayisi = $toplamEntrySayisi / 10;
if (($toplamEntrySayisi % 10) > 0) {$sayfaSayisi = $sayfaSayisi + 1;}
echo "<table>\n<tr>\n";
for ($i=1; $i <= $sayfaSayisi; $i++) {
    echo "\t<td><a href=\"index.php?baslik=$baslik&s=$i\"> $i </a></td>\n";}
echo "</tr></table>";

include("entrygir.php");
?>